//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_getloadedmags2.sqf"
#include "x_setup.sqf"

private ["_weapon", "_muzzles", "_ar_magdets", "_ar_mags"];
PARAMS_1(_weapon);
if (_weapon == "") exitWith {[[],[]]};
_muzzles = getArray(configFile>>"cfgWeapons" >> _weapon >> "muzzles");
__TRACE_1("","_muzzles");
if (typeName _muzzles != "ARRAY") exitWith {[[],[]]};
_ar_magdets = [];
_ar_mags = [];
{
	_which = if (_x == "this") then {_weapon} else {_x};
	__TRACE_1("","_which");
	_p selectWeapon _which;
	_ar_magdets set [count _ar_magdets, currentMagazineDetail _p];
	_ar_mags set [count _ar_mags, currentMagazine _p];
} forEach _muzzles;
__TRACE_1("","_ar_magdets");
__TRACE_1("","_ar_mags");
//_magsext = magazinesExt player;
//__TRACE_1("","_magsext");
[_ar_magdets, _ar_mags]
